import 'package:factoryside/bean/wx_pay_info_entity.dart';

wxPayInfoEntityFromJson(WxPayInfoEntity data, Map<String, dynamic> json) {
	if (json['StatusCode'] != null) {
		data.statusCode = json['StatusCode'] is String
				? int.tryParse(json['StatusCode'])
				: json['StatusCode'].toInt();
	}
	if (json['Info'] != null) {
		data.info = json['Info'].toString();
	}
	if (json['Count'] != null) {
		data.count = json['Count'] is String
				? int.tryParse(json['Count'])
				: json['Count'].toInt();
	}
	if (json['Data'] != null) {
		data.data = new WxPayInfoData().fromJson(json['Data']);
	}
	return data;
}

Map<String, dynamic> wxPayInfoEntityToJson(WxPayInfoEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['StatusCode'] = entity.statusCode;
	data['Info'] = entity.info;
	data['Count'] = entity.count;
	if (entity.data != null) {
		data['Data'] = entity.data.toJson();
	}
	return data;
}

wxPayInfoDataFromJson(WxPayInfoData data, Map<String, dynamic> json) {
	if (json['Item1'] != null) {
		data.item1 = json['Item1'];
	}
	if (json['Item2'] != null) {
		data.item2 = new WxPayInfoDataItem2().fromJson(json['Item2']);
	}
	return data;
}

Map<String, dynamic> wxPayInfoDataToJson(WxPayInfoData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Item1'] = entity.item1;
	if (entity.item2 != null) {
		data['Item2'] = entity.item2.toJson();
	}
	return data;
}

wxPayInfoDataItem2FromJson(WxPayInfoDataItem2 data, Map<String, dynamic> json) {
	if (json['appid'] != null) {
		data.appid = json['appid'].toString();
	}
	if (json['noncestr'] != null) {
		data.noncestr = json['noncestr'].toString();
	}
	if (json['out_trade_no'] != null) {
		data.outTradeNo = json['out_trade_no'].toString();
	}
	if (json['package'] != null) {
		data.package = json['package'].toString();
	}
	if (json['partnerid'] != null) {
		data.partnerid = json['partnerid'].toString();
	}
	if (json['prepayid'] != null) {
		data.prepayid = json['prepayid'].toString();
	}
	if (json['sign'] != null) {
		data.sign = json['sign'].toString();
	}
	if (json['timestamp'] != null) {
		data.timestamp = json['timestamp'].toString();
	}
	return data;
}

Map<String, dynamic> wxPayInfoDataItem2ToJson(WxPayInfoDataItem2 entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['appid'] = entity.appid;
	data['noncestr'] = entity.noncestr;
	data['out_trade_no'] = entity.outTradeNo;
	data['package'] = entity.package;
	data['partnerid'] = entity.partnerid;
	data['prepayid'] = entity.prepayid;
	data['sign'] = entity.sign;
	data['timestamp'] = entity.timestamp;
	return data;
}